﻿using System;
using System.Collections;
using System.Web;
using System.Web.Services;
using BLL;
using Model;

namespace GeniusAdminWebApplication
{
    public partial class addUser : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        [WebMethod]
        public static string ajaxAddUser(string name, string username, string password, int departmentId)
        {
            AdminService adminService = new AdminService();
            Hashtable ht = adminService.addUser(name, username, password, departmentId);
            new SystemLogService().saveSystemLog((User)HttpContext.Current.Session["admin"], "添加成员：" + name);
            string result = (string)ht["result"];
            string message = (string)ht["message"];
            return "{" +
                        "result:'" + result + "'," +
                        "message:'" + message + "'" +
                    "}";
        }

    }
}